import rRequest from "@/assets/axios/request.js";

export default {
    uploadFile(payload) {
        return new Promise((resolve, reject) => {
            let formData = new FormData();
            formData.append('file', payload);
            formData.append('source', "xuetang");
            formData.append('fileType', 'picture')

            rRequest.POST({
                url: "/file/upload/file",
                data: formData,
                headers: {
                    'Content-Type': 'multipart/form-data'
                }
            }).then(res => {
                resolve(res);
            }).catch(e => {
                reject(e);
            })
        })
    }
}
